﻿using PARK.Common.Const;
using SqlSugar;
using System;
using Yitter.IdGenerator;

namespace PARK.Accessctl.Entitys
{
    /// <summary>
    /// 时钟同步记录
    /// </summary>
    [SugarTable("equ_clocksyn")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class EquclocksynEntity
    {
        /// <summary>
        /// Id
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// equType
        /// </summary>
        [SugarColumn(ColumnName = "equType")]
        public int? equType { get; set; }

        /// <summary>
        /// equId
        /// </summary>
        [SugarColumn(ColumnName = "equId")]        
        public string equId { get; set; }

        /// <summary>
        /// equSN
        /// </summary>
        [SugarColumn(ColumnName = "equSN")]        
        public string equSN { get; set; }

        /// <summary>
        /// equName
        /// </summary>
        [SugarColumn(ColumnName = "equName")]
        public string equName { get; set; }
        
        /// <summary>
        /// 所在区域
        /// </summary>
        [SugarColumn(ColumnName = "doorAreaId")]        
        public string DoorAreaId { get; set; }
        
        /// <summary>
        /// 所在区域名称
        /// </summary>
        [SugarColumn(ColumnName = "doorAreaName")]        
        public string DoorAreaName { get; set; }
        
        /// <summary>
        /// 所在位置
        /// </summary>
        [SugarColumn(ColumnName = "ctlposition")]        
        public string Ctlposition { get; set; }

        /// <summary>
        /// IsSyntime
        /// </summary>
        [SugarColumn(ColumnName = "IsSyntime")]        
        public int IsSyntime { get; set; }

        /// <summary>
        /// LastSyntime
        /// </summary>
        [SugarColumn(ColumnName = "LastSyntime")]        
        public DateTime? LastSyntime { get; set; }

        /// <summary>
        /// dbDate
        /// </summary>
        [SugarColumn(ColumnName = "dbDate")]
        public DateTime? dbDate { get; set; }

        /// <summary>
        /// 所属公司Id
        /// </summary>
        [SugarColumn(ColumnName = "CompanyId")]
        public string CompanyId { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [SugarColumn(ColumnName = "CompanyName")]
        public string CompanyName { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        [SugarColumn(ColumnName = "Description")]        
        public string Description { get; set; }
        /// <summary>
        /// 创建
        /// </summary>
        public virtual void Create()
        {
            this.Id = YitIdHelper.NextId().ToString(); 
        }

        /// <summary>
        /// 修改
        /// </summary>
        public virtual void LastModify(string Id)
        {
            this.Id = Id;
        }
    }
}